﻿
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserList.aspx.cs" Inherits="TrainingWorkshop.MVPWebsite.User.Views.UserList"
    Title="UserList" MasterPageFile="~/Shared/DefaultMaster.master" %>
<asp:Content ID="content" ContentPlaceHolderID="DefaultContent" Runat="Server">
        <h1>User List</h1>
        <asp:Panel ID="SearchUserPanel" runat="server" GroupingText="Search User" 
            Height="81px" Width="621px">
         <table border="0" cellpadding="0" cellspacing="0" bgcolor="White">
            <tr>
            <td align="center" bgcolor="White" valign="middle" width="100" colspan="0" style="height: 25px">
                    First Name
                </td>
                <td align="center" bgcolor="White" valign="middle" width="80" colspan="0" style="height: 25px">
                    <asp:TextBox ID="FirstNameTextBox" runat="server" Width="108px"></asp:TextBox>
                </td>
                <td align="center" bgcolor="White" valign="middle" width="100" colspan="0" style="height: 25px">
                    Last Name
                </td>
                <td align="center" bgcolor="White" valign="middle" width="80" colspan="0" style="height: 25px">
                    <asp:TextBox ID="LastNameTextBox" runat="server" Width="108px"></asp:TextBox>
                </td>
                <td align="center" bgcolor="White" valign="middle" width="100" colspan="0" style="height: 25px">
                    Department
                </td>
                <td align="center" bgcolor="White" valign="middle" width="80" colspan="0" style="height: 25px">
                    <asp:DropDownList ID="DepartmentDropDownList" runat="server" Width="108px">
                    </asp:DropDownList>
                </td>
                <td align="center" bgcolor="White" valign="middle" width="40" colspan="0" style="height: 25px">
                </td>
                <td align="center" bgcolor="White" valign="middle" width="80" colspan="0" style="height: 25px">
                    <asp:Button ID="SearchButton" runat="server" Text="   Search" OnClick="SearchButton_Click" Style="background-color: Transparent;background-image: url(../images/search.jpg); background-position: left center;background-repeat: no-repeat"/>
                </td>
            </tr>
        </table>
        
        </asp:Panel>
        <asp:Panel ID="UserListPanel" runat="server" GroupingText="User List" 
    Width="621px" style="margin-right: 0px">
        <table border="0" cellpadding="0" cellspacing="0" bgcolor="White">
            <tr>
            <td align="center" bgcolor="White" valign="middle" width="80" colspan="0" style="height: 25px">
                    <asp:Button ID="CreateNewUserButton" runat="server" 
                onclick="CreateNewUserButton_Click" Text=" Create New User" Style="background-color: Transparent;background-image: url(../images/edit.jpg); background-position:left center ;background-repeat:no-repeat"/>
                </td>
            </tr>
        </table>
        <br />
        <br />
            <asp:GridView ID="UserListGridView" runat="server" AutoGenerateColumns="False" 
                CellPadding="4" ForeColor="#333333" GridLines="None" 
                onrowdatabound="UserListGridView_RowDataBound" 
                onrowdeleting="UserListGridView_RowDeleting" 
                onrowediting="UserListGridView_RowEditing" Width="592px">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="UserId">
                        <EditItemTemplate>
                            <asp:Label ID="UserIdLabel" runat="server" Text='<%# Bind("UserId") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="UserIdLabel" runat="server" Text='<%# Bind("UserId") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="FirstName">
                        <EditItemTemplate>
                            <asp:TextBox ID="FirstNameTextBox0" runat="server" 
                                Text='<%# Bind("FirstName") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Bind("FirstName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="LastName">
                        <EditItemTemplate>
                            <asp:TextBox ID="LastNameTextBox0" runat="server" 
                                Text='<%# Bind("LastName") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="LastNameLabel" runat="server" Text='<%# Bind("LastName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="DepartmentName">
                        <EditItemTemplate>
                            <asp:TextBox ID="DepartmentIdTextBox" runat="server" 
                                Text='<%# Bind("Department.DepartmentName") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="DepartmentIdLabel" runat="server" 
                                Text='<%# Bind("Department.DepartmentName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="RoleName">
                        <EditItemTemplate>
                            <asp:TextBox ID="RoleIdTextBox" runat="server" 
                                Text='<%# Bind("Role.RoleName") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="RoleIdLabel" runat="server" Text='<%# Bind("Role.RoleName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Management" ShowHeader="False">
                        <EditItemTemplate>
                            <asp:LinkButton ID="EditLinkButton" runat="server" CausesValidation="True" 
                                CommandName="Update" Text="Update"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" 
                                CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:LinkButton ID="EditLinkButton" runat="server" CausesValidation="False" 
                                CommandName="Edit" Text="Edit"></asp:LinkButton>
                            &nbsp;<asp:LinkButton ID="DeleteLinkButton" runat="server" CausesValidation="False" 
                                CommandName="Delete" Text="Delete"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="Black" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
        <br />
        </asp:Panel>
        <br/>

</asp:Content>
